<%--
    Document   : index
    Created on : Mar 10, 2014, 10:54:45 PM
    Author     : Anton Strack
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib prefix="csd" tagdir="/WEB-INF/tags" %>
<%-- If the JSP file is called directly from a URL instead of from the controller, go to controller.        --%>
<%@include file="/common/redirect.jsp" %>

<!DOCTYPE html>
<html lang="en">
    <head>
        <title>Create Access Control</title>
        <%@include file="/common/header.jsp" %>
    </head>
    <body id="main">
        <%@include file="/common/topNavigation.jsp" %>

        <div class="container panel">
            <div class="panel-heading">
                <h1>Create Access Control</h1>
            </div>
            <div class="panel-body row">
                <%@include file="/common/siteColumn.jsp" %>
                <div class="col-lg-8 csd_content_column">
                    <csd:displayResultMessage></csd:displayResultMessage>
                        <div class="csd_content_form">
                            <form method="POST" action="${config.getPath()}">
                            <div class="form-group">
                                <label class="form-control" for="role">Role:</label>
                                <select class="form-control" id="role" name="role">
                                    <c:forEach items="${roles}" var="role" >
                                        <option value="${role.id}">${role.name}</option>
                                    </c:forEach>
                                </select>
                                <br />
                                <label class="form-control" for="action">Action:</label>
                                <select class="form-control" id="action" name="action" multiple size="5">
                                    <c:forEach items="${actions}" var="action" >
                                        <option value="${action.id}">${action.name}</option>
                                    </c:forEach>
                                </select>
                                <br />
                                <label class="form-control" for="resourceType">Resource Type</label>
                                <select class="form-control" id="resourceType" name="resourceType" multiple size="5">
                                    <c:forEach items="${resourceTypes}" var="resourceType" >
                                        <option value="${resourceType.id}">${resourceType.name}</option>
                                    </c:forEach>
                                </select>
                                <br />
                                <label class="form-control" for="owned">Ownership</label>
                                <select class="form-control" id="owned" name="owned">
                                    <option value="1">Owned</option>
                                    <option value="0">Not Owned</option>
                                </select>
                                <br />
                                <label class="form-control" for="access">Access:</label>
                                <select class="form-control" id="access" name="access">
                                    <option value="1">Allow</option>
                                    <option value="0">Deny</option>
                                </select>
                                <br />
                                <label class="form-control" for="returnToFormOnSuccess">Save to database and return to form.</label>
                                <input class="form-control" type="checkbox" name="returnToFormOnSuccess" id="returnToFormOnSuccess" value="1" />
                                <br />
                            </div>

                            <button class="btn btn-primary" name="formSubmit" id="formSubmit" value="create-accesscontrollist" type="submit">Create ACL</button>
                        </form>
                    </div>
                </div>
                <%@include file="/common/userColumn.jsp" %>
            </div>
            <div id="footer">
                <script src="assets/ckeditor/ckeditor.js"></script>
                <%@include file="/common/footer.jsp" %>
            </div>
        </div>
    </body>
</html>

